/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-06 11:33:19  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.bp.entity;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "WWYT_BP_REGULATION_DOCUMENT")
@SQLDelete(sql = "update WWYT_BP_REGULATION_DOCUMENT set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_BP_REGULATION_DOCUMENT set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class BpRegulationDocument implements java.io.Serializable {

    // columns START
    // ID
    private Long id;
    // 文档名称
    private String name;
    // 文档类型ID
    private Long documentTypeId;
    // 制定人
    private Long makeUserId;
    // 状态
    private Integer state;
    // 内容
    private String content;
    // 附件ID
    private Long attachmentId;
    // 编制时间
    private java.util.Date makeTime;
    // 备注
    private String remark;
    // 审核人
    private Long auditUserId;
    // 审核时间
    private java.util.Date auditTime;
    // 审核备注
    private String auditRemark;


    // columns END
    // 删除状态
    private String deleteFlag;
    private String orgCode;
    private Long tenentId;

    @Column(name = "DELETE_FLAG")
    public String getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(String deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return tenentId;
    }

    public void setTenentId(Long tenentId) {
        this.tenentId = tenentId;
    }

    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    @Column(name = "NAME", length = 100)
    public String getName() {
        return this.name;
    }

    public void setName(String value) {
        this.name = value;
    }

    @Column(name = "DOCUMENT_TYPE_ID")
    public Long getDocumentTypeId() {
        return this.documentTypeId;
    }

    public void setDocumentTypeId(Long value) {
        this.documentTypeId = value;
    }

    @Column(name = "MAKE_USER_ID")
    public Long getMakeUserId() {
        return this.makeUserId;
    }

    public void setMakeUserId(Long value) {
        this.makeUserId = value;
    }

    @Column(name = "STATE")
    public Integer getState() {
        return this.state;
    }

    public void setState(Integer value) {
        this.state = value;
    }

    @Column(name = "CONTENT")
    public String getContent() {
        return this.content;
    }

    public void setContent(String value) {
        this.content = value;
    }

    @Column(name = "ATTACHMENT_ID")
    public Long getAttachmentId() {
        return this.attachmentId;
    }

    public void setAttachmentId(Long value) {
        this.attachmentId = value;
    }

    @Column(name = "MAKE_TIME")
    public java.util.Date getMakeTime() {
        return this.makeTime;
    }

    public void setMakeTime(java.util.Date value) {
        this.makeTime = value;
    }

    @Column(name = "REMARK")
    public String getRemark() {
        return this.remark;
    }

    public void setRemark(String value) {
        this.remark = value;
    }

    @Column(name = "AUDIT_USER_ID")
    public Long getAuditUserId() {
        return this.auditUserId;
    }

    public void setAuditUserId(Long value) {
        this.auditUserId = value;
    }

    @Column(name = "AUDIT_TIME")
    public java.util.Date getAuditTime() {
        return this.auditTime;
    }

    public void setAuditTime(java.util.Date value) {
        this.auditTime = value;
    }

    @Column(name = "AUDIT_REMARK", length = 200)
    public String getAuditRemark() {
        return this.auditRemark;
    }

    public void setAuditRemark(String value) {
        this.auditRemark = value;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("name", getName())
                .append("documentTypeId", getDocumentTypeId()).append("makeUserId", getMakeUserId())
                .append("state", getState()).append("attachmentId", getAttachmentId()).append("makeTime", getMakeTime())
                .append("auditUserId", getAuditUserId()).append("auditTime", getAuditTime())
                .append("auditRemark", getAuditRemark()).toString();
    }



    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpRegulationDocument == false)
            return false;
        if (this == obj)
            return true;
        BpRegulationDocument other = (BpRegulationDocument) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
